Calculations

 The   Algebra System (G.A.S.)
 
  provides many predefined operations, functions and constants.

 

Overview

 

geometric functions

Geometric functions require  -objects as inputs. Simply specify the name of the object. Objects whith names containing indices have to be written using _.

E.g. the label of the circle above was input as k_a, but is displayed as ka.

 

x-component

Input

  • X(point)
point is a point in  . X returns the value of the x-coordinate of the point.

Example

  • X(A) with A(2.23;1.3) returns 2.23

 

y-component

Input

  • Y(point)
point is a point in  . Y returns the value of the y-coordinate of the point.

Example

  • Y(A) with A(2.23;1.3) returns 1.3

 

Distance of two points

Input

  • Dist(point1,point2)
The distance of two  -points point1 and point2 is calculated with Dist.

Example

  • Dist(A,B) with A(1;0) and B(0;1) returns 1.414...

 

Length of a segment

Input

  • L(segment)
segment is a segment in  . L returns the length of the segment. If segment is a line, a ray or a vector then L returns the distance of the two defining points.

Example

  • L(a) with a defined by A(1;0) and B(0;1) returns 1.414...

 

Radius of a circle

Input

  • R(circle)
circle is a circle in  . R returns the length of the radius. Indices have to be written with _ (see example).

Example

  • R(k_a) returns the radius of k_a

 

Measuring angles in degrees

Input

  • Deg(punkt1,punkt2,punkt3)
Deg returns the angle point1 (on the first side of the angle) point2 (vertex) point3 (on the second side of the angle) measured in degrees. The mathematical orientation of the angle is of relevance.

Example

  • Deg(A,B,C) with A(1;0), B(0;1) and C(1;1) returns 45.0

 

Measuring angles in radian measure

Input

  • Rad(point1,point2,point3)
Rad returns the angle point1 (on the first side of the angle) point2 (vertex) point3 (on the second side of the angle) measured in radian measure.

Example

  • Rad(A,B,C) with A(1;0), B(0;1) and C(1;1) returns 0.785...

 

parallel-function

Input

  • Par(line1,line2)
If line1 and line2 are parallel, Par returns True, otherwise Par returns False.

Example

  • Par(a,b) with a || b returns True

 

Orthogonal-function

Input

  • Ortho(line1,line2)
If line1 and line2 are orthogonal to each other, Ortho returns True, otherwise Ortho returns False.

Example

  • Ortho(a,b) with a || b returns False

 

 Top of Page

 

 

Arithmetic operations

 

Addition

Input

  • argument1 + argument2

 

Subtraction

Input

  • argument1 - argument2

 

Multiplication

Input

  • argument1 * argument2

 

Division

Input

  • argument1 / argument2

 

 Top of Page

 

 

Arithmetic Functions

 

(natural) exponential function

Input

  • Exp(argument)
Exapmles
  • Exp(x)
  • Exp(X(A))

 

natural logarithm

Input

  • Log(argument)
Examples
  • Log(x)
  • Log(X(A))
  • Log(E^2) returns 2

 

exponentiate

Inputs

  • Pow(base, exponent)
  • base^exponent
Exapmles
  • Pow(3, x) means 3^x
  • x^2
  • Y(C)^2

 

square root

Input

  • Sqrt(argument)
Examples
  • Sqrt(x)
  • Sqrt(Y(B))

 

 Top of Page

 

 

differentiate

Input

  • D(expression, variable)
  • D(expression, {variable, n})
  • D(expression, variable)/.variable->value
  • D(expression, {variable, n})/.variable->value
The function D differentiates expression with respect to variable. n specifies that the nth derivative is returned. If value is specified the derivative is evaluated for this value.

Examples

  • D(Sin(x),x) returns Cos(x)
  • D(Sin(x),{x,2}) returns -Sin(x)
  • D(Sin(x),x)/.x->Pi/2 returns 0
  • D(Sin(x),{x,2})/.x->Pi/2 returns -1

 

 Top of Page

 

 

integrate

Input

  • Int(expression, variable)
  • Int(expression, variable)/.variable->value
The function Int integrates expression with respect to variable. If value is specified the antiderivative is evaluated for this value.

Examples

  • Int(Sin(x),x) returns -Cos(x)
  • Int(Sin(x),x)/.x->Pi returns 1

 

 Top of Page

 

 

trigonometric functions

 

arc cosine

Input

  • ACos(argument)
Exapmles
  • ACos(x)
  • ACos(X(A))

 

arc sine

Input

  • ASin(argument)
Exapmles
  • ASin(x)
  • ASin(X(A))

 

arc tangent

Input

  • ATan(argument)
Examples
  • ATan(x)
  • ATan(X(A))

 

cosine

Input

  • Cos(argument)
Examples
  • Cos(x)
  • Cos(X(A))

 

cotangent

input

  • Cot(argument)
Examples
  • Cot(x)
  • Cot(X(A))

 

sine

Input

  • Sin(argument)
Examples
  • Sin(x)
  • Sin(X(A))

 

tangent

Input

  • Tan(argument)
Examples
  • Tan(x)
  • Tan(X(A))

 

 Top of Page

 

 

more functions

 

absolute value

Input

  • Abs(argument)
Exapmles
  • Abs(-2) returns 2
  • Abs(x) returns -x if x<0, otherwise x

 

maximum

Input

  • Max(argument1, ... , argumentN)
Examples
  • Max(1,2,3) returns 3
  • Max(-3,0.4,-5.1) returns 0.4

 

minimum

Input

  • Min(argument1, ... , argumentN)
Exapmles
  • Min(1,2,3) returns 1
  • Min(-3,0.4,-5.1) returns -5.1

 

numerical evaluation

Input

  • N(argument)
Examples
  • N(Sqrt(2)) returns 1.414...
  • N(E) returns 2.718...

 

round

Input

  • Round(argument, n)
argument is rounded to n decimal places. If the rounded value ends with 0 this 0 is not displayed. If n is 0, the result is displayed with .0.

Examples

  • Round(2.234623,2) returns 2.23
  • Round(2.234623,3) returns 2.235
  • Round(2.234623,0) returns 2.0
  • Round(2.2300000,4) returns 2.23

 

signum

Input

  • Sign(argument)
Examples
  • Sign(-2) returns -1
  • Sign(5.56) returns 1
  • Sign(x) returns -1 if x<0, 0 if x=0 and 1 if x>0

 

truncate

Input

  • Trunc(number)
The decimal places are Trunc cut off. The result is displayed as an integer followed by .0.

Examples

  • Trunc(3.523453) returns 3.0
  • Trunc(-3.4564564) returns -3.0

 

 Top of Page

 

 

logical operators

 

"equal"-operator

Input

  • argument1 == argument2

 

"greater than"-operator

Input

  • argument1 > argument2

 

"greater than or equal to"-operator

Input

  • argument1 >= argument2

 

"lesser than"-operator

Input

  • argument1 < argument2

 

"lesser than or equal to"-operator

Input

  • argument1 <= argument2

 

"unequal"-Operator

Eingabe

  • argument1 != argument2

 

 Top of Page

 

 

logical functions

 

logical AND

Input

  • And(argument1, ... , argumentN)
  • argument1 && ... && argumentN
And returns True, if all arguments are True. Otherwise And returns False.

Examples

  • And(5>0,3<Pi) returns True
  • a && b with a=False and b=True returns False

 

logical OR

Input

  • Or(argument1, ... , argumentN)
  • argument1 || ... || argumentN
Or returns True, if at least one of the arguments is True. If all arguments are False, Or returns False.

Examples

  • Or(5>0,3>Pi) returns True
  • a || b with a=False and b=True returns True

 

condition

Input

  • If(condition, true, false)
If condition returns True, true is executed, otherwise false is.

Examples

  • If(5>0,5.3,4.0) returns 5.3
  • If(5<0,5.3,4.0) returns 4.0
  • If(X(A)<0,X(B)=5,X(B)=X(A)) eith X(A)=-2.5 returns X(B)=5

 

 Top of Page

 

 

constants

 

Pi

Input

  • Pi

 

Euler's constant

Input

  • E

 

False

Input

  • False

 

True

Input

  • True

 

 Top of Page

 

 
See Also: